// ??(stone)

#include <bits/stdc++.h>
using namespace std;
#define int long long

const int N = 1e6 + 10, INF = 0x3f3f3f3f3f3f3f3f;
struct QUERY {
	string op;
	int l, r;
}gQ[N];
struct SEG {
	int l, r;
	
	friend bool operator < (const SEG &x, const SEG &y) {
		if (x.l != y.l) return x.l < y.l;
		return x.r < y.r;
	}
	
	friend bool operator > (const SEG &x, const SEG &y) {
		if (x.l != y.l) return x.l > y.l;
		return x.r > y.r;
	}
}all;
multiset<int> gL[N]; multiset<int, greater<int> > gR[N];
int mxn;

bool Zero(SEG seg) {
	return seg.l > seg.r;
}

SEG Adjust(SEG seg) {
	if (Zero(seg)) return (SEG){mxn, 1};
	return seg;
}

SEG Merge(SEG l, SEG r) {
	if (Zero(l) || Zero(r)) return (SEG){mxn, 1};
	
	return Adjust((SEG){max(l.l, r.l), min(l.r, r.r)});
}

SEG Plus(SEG l, SEG r) {
	return Adjust((SEG){min(l.l, r.l), max(l.r, r.r)});
}

struct SEG1 {
	struct T {
		int sum, mx, tg;
	}gT[N * 4];
	
	void PushUp(int p) {
		gT[p].sum = gT[p * 2].sum + gT[p * 2 + 1].sum;
		gT[p].mx = max(gT[p * 2].mx, gT[p * 2 + 1].mx);
	}
	
	void AddTag(int p, int l, int r, int d) {
		gT[p].tg += d, gT[p].sum += (r - l + 1) * d, gT[p].mx += d;
	}
	
	void PushDown(int p, int l, int r) {
		if (gT[p].tg) {
			int mid = (l + r) / 2;
			AddTag(p * 2, l, mid, gT[p].tg);
			AddTag(p * 2 + 1, mid + 1, r, gT[p].tg);
			gT[p].tg = 0;
		}
	}
	
	void Update(int p, int l, int r, int x, int y, int d) {
		if (x <= l && r <= y) {
			AddTag(p, l, r, d);
			return;
		}
		
		PushDown(p, l, r);
		
		int mid = (l + r) / 2;
		if (x <= mid) Update(p * 2, l, mid, x, y, d);
		if (y > mid) Update(p * 2 + 1, mid + 1, r, x, y, d);
		
		PushUp(p);
	}
	
	int Query(int p, int l, int r, int x, int y) {
		if (x <= l && r <= y) return gT[p].mx;
		
		PushDown(p, l, r);
		
		int mid = (l + r) / 2, mx = -INF;
		if (x <= mid) mx = max(mx, Query(p * 2, l, mid, x, y));
		if (y > mid) mx = max(mx, Query(p * 2 + 1, mid + 1, r, x, y));
		
		return mx;
	}	
	
	void FindZero(int p, int l, int r) {
		// cout << l << " " << r << ":" << gT[p].sum << endl;
		if (!gT[p].sum) {
			all = Plus(all, (SEG){l, r});
			return;
		}
		
		if (gT[p].mx || l == r) return;
		
		PushDown(p, l, r);
		
		int mid = (l + r) / 2;
		FindZero(p * 2, l, mid);
		FindZero(p * 2 + 1, mid + 1, r);
	}
}gSeg1;

struct SEG2 {
	struct T {
		set<int> rht, tg;
		int mn;
	}gT[N * 4];
	
	void PushUp(int p) {
		
	} 
};

signed main() {
	freopen("stone.in", "r", stdin);
	freopen("stone.out", "w", stdout);
	
	ios::sync_with_stdio(false);
	
	int q;
	cin >> q;
	
	mxn = 0;
	for (int i = 1; i <= q; i++)
		cin >> gQ[i].op >> gQ[i].l >> gQ[i].r, gQ[i].r--, mxn = max(mxn, gQ[i].r);
	
	int num = 0;
	for (int i = 1; i <= q; i++) {
		string op = gQ[i].op; int l = gQ[i].l, r = gQ[i].r; 
		if (op == "A") num++, gSeg1.Update(1, 1, mxn, l, r, 1), gSeg1.Update(1, 1, mxn, 1, mxn, -1), gL[l].insert(r), gR[r].insert(l);
		else num--, gSeg1.Update(1, 1, mxn, l, r, -1), gSeg1.Update(1, 1, mxn, 1, mxn, 1), gL[l].erase(gL[l].find(r)), gR[r].erase(gR[r].find(l));
		
//		cout << "segt:\n";
//		for (int j = 1; j <= mxn; j++)
//			cout << gSeg1.Query(1, 1, mxn, j, j) << " ";
//		cout << endl;
		
		all = (SEG){mxn, 1};
		gSeg1.FindZero(1, 1, mxn);
		
		// cout << "seg:" << all.l << "~" << all.r << endl;
		if (num == 1) cout << all.r - all.l + 1 << endl;
		else if (!Zero(all)) {
//			cout << "chk:\n";
//			for (auto it : gR[all.r]) cout << it << " "; cout << endl;
//			for (auto it : gL[all.l]) cout << it << " "; cout << endl;
			
			cout << *(gL[all.l].begin()) - *(gR[all.r].begin()) + 1 << endl;
		} else {
			cout << "I cant solve this problem: They arent intersect. 20pts\n";
			cout << "BF to find right side of the segments. We need to minimize the length of the merged segments.\n";
			cout << "If it happens, the amount of the segments must be 2. Otherwise, it isnt optimized.\n";
			cout << "Sort the segments by their left side. Use SegTree on right sides. Parameter: lftmax/rhtmin.\n";
			cout << "Left Side is easy. We can just use std::set to choose the leftest segment(use set to delete).\n";
			cout << "Cant solve Right Side becase its a suffixed min. And even contains delete operations!\n";
			cout << "History-Min on SegTree? or maintain set on a SegTree?\n";
			return 0;
		}
	}
	
	return 0;
}

/*
1#
5
A 1 5
A 2 7
A 4 6
A 6 8
R 4 6
*/
